package com.h819.core.collection.comparator;

import java.util.Comparator;

/**
 * @ClassName: Example
 * @Description: TODO(集合比较器实现例子，可以参见 commons cellection 功能包，有更多的用法)
 * @author h819
 * @date Sep 2, 2009 4:10:33 PM
 * @version V1.0
 */

public class Example implements Comparator<String[]> {

	// 返回值意义

	// a negative integer, zero, or a positive integer as the first argument is
	// less than, equal to, or greater than the second.

	public int compare(String[] a, String[] b) {

		
//		if (a[0].equals(b[0]) && a[1].equals(b[1]) && a[2].equals(b[2])
//				&& a[3].equals(b[3]))
//			return 0;
		
		if (a == null || b == null || a.length != 3 || b.length != 3)
			return -1;

		return a[2].compareTo(b[2]);

	}

}
